package com.softserveinc.lahire.builders;

public class ResponseDirector {
	private ResponseBuilder responseBuilder;
	
	public void setResponseBuilder(ResponseBuilder responseBuilder){
		this.responseBuilder = responseBuilder;
	}

	public Response getResponse(){
		return responseBuilder.getResponse();
	}

	public void constructResponse(byte[] body, String contentType, int statusCode){
		
		responseBuilder.createNewResponse(body.length, contentType,statusCode);
		responseBuilder.buildHeaders();
		responseBuilder.appendBody(body);
	}
	public void constructResponse(byte[] body, String contentType, int statusCode, String setCookie){
		
		responseBuilder.createNewResponse(body.length, contentType,statusCode,setCookie);
		responseBuilder.buildHeaders();
		responseBuilder.appendBody(body);
	}
	
}

